#ifndef LINEPLANTYPES_H
#define LINEPLANTYPES_H
#include <vector>
#include <list>
#include <QtXml>
#include <QString>
//lp_types.h - Custom Types for storing route data in memory

#ifndef Tuple
struct Tuple;
#endif //Tuple

typedef std::list<Tuple>::iterator TupleItr;

struct Tuple{
    //A tuple is a single element in a DOM tree, stored in an STL list.
    //It stores an iterator to its parent, allowing for multiple children
    //and thus creating a hierarchical structure.

    Tuple(TupleItr p, QDomNode c){parent = p; self = c.cloneNode(true);}
    //It is imperative for the Tuple constructor to make a deep copy of a node,
    //otherwise recursive operations don't work

    TupleItr parent;
    QDomNode self;
};

struct StopData{
    //A memory resident representation of a bus stop
    QString stopName;
    int order;
    QString correspondances;
    bool nextLineIsSecondary;
    QString nextLineCaption;
};
typedef std::vector<StopData>::iterator StopItr;

#endif // LINEPLANTYPES_H
